﻿<%@ Page Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="BmList.aspx.cs"
    Inherits="RN.ERP.Web.Exam.BmList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Styles/skins/blue/css/kendo.common.min.css" type="text/css" rel="stylesheet" />
    <link href="../Styles/skins/blue/css/kendo.blueopal.min.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript" language="javascript" src="../Scripts/kendo.web.min.js"></script>
    <script type="text/javascript">
        var payNoticeWin;

        function OpenAlert(text) {
            $.ligerDialog.warn(text);
            return false;
        }

        /*
        *向支付页面Post数据并跳转
        */
        function GoToPayPage(paraData) {
            var data = eval('(' + paraData + ')');
            var form;

            if ($("#payHidForm").length > 0) {
                form = $("#payHidForm");
            } else {
                form = $("<form id='payHidForm'></form>");
            }
            form.attr("action", "<%=PayWebSite %>");
            form.attr("method", "post");
            form.attr("target", "_blank");
            for (var attrName in data) {
                $("<input type=hidden />").attr({name:attrName,value:data[attrName]}).appendTo(form);
            }
            form.appendTo(document.body);
            form.submit();
            form.empty();

            ////弹出支付等待提示
            ShowPayNoticeWin();
        }

        function RefreshWin() {
            window.location.href = window.location.href;
        }

        function CloseWin(data) {
            if (data == "1") {
                RefreshWin();
            }
        }

        $(function () {
            $('#RadGrid1 input[type="checkbox"]').click(function () {
                if ($(this).attr('checked')) {
                    $('input[type="checkbox"]').removeAttr('checked');
                    $(this).attr('checked', 'checked');
                }
            });
        })

        function IsAnyItemSelected() {
            var chk = $("#RadGrid1 input:checked");
            var qcid = chk.eq(0).attr("flag"); //期次id

            if (chk.length == 0) {
                return OpenAlert("请选择要操作的报名！");
            } else {
                $("#hidQCID").val(qcid);
                setTimeout(function () {
                    $("#lbBMPay").attr("disabled", "disabled");
                }, 0);
                return true;
            }
        }

        function ShowPayNoticeWin() {
            if (!payNoticeWin) {
                $("#window").kendoWindow({
                    width: "600px",
                    height: "300px",
                    title: "提醒",
                    modal: true,
                    draggable: true,
                    visible: false,
                    close: function (e) {
                        // close animation has finished playing
                    }
                });
                payNoticeWin = $("#window").data("kendoWindow");
            }
            $(".k-window-actions").empty();
            payNoticeWin.center().open();
        }
    </script>
  
    <style type="text/css">
        .xtbiao1
        {
            background: none repeat scroll 0 0 #43A9F5;
            color: #FFFFFF;
            float: right;
            height: 25px;
            line-height: 25px;
            margin-left: 10px;
            text-align: center;
            padding: 0px 10px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" style="table-layout: fixed; margin-top: 5px;" border="0" cellspacing="0"
        cellpadding="0" align="center">
        <tr>
            <td class="xx_m  tt_xx_l">
            </td>
            <td class="xx_m  tt_xx_icon">
            </td>
            <td style="width: auto;" class="xx_m">
                考试报名列表
            </td>
            <td style="width: 14px;">
                <img src="../images/xx_r.jpg" width="14" height="33" />
            </td>
        </tr>
        <tr>
            <td class="left_con">
                &nbsp;
            </td>
            <td colspan="2" style="padding-left: 6px; padding-right: 6px;" valign="top">
                <div>
                    <div class="xian">
                        <div class="about_title">
                            <asp:Label ID="lbAreaTitle" runat="server" Text="考试报名列表"></asp:Label>
                        </div>
                        <div class="i-con-cn">
                            <span id="spReturn" runat="server">
                                <a style="cursor: pointer;" class="xtbiao1" href="BmManage.aspx">返 回</a>
                            </span>
                            <span id="search" runat="server" style="float: right;">
                                <asp:LinkButton runat="server" class="xtbiao1" ID="btnSearch" 
                                    OnClick="btnSearch_Click">查 询</asp:LinkButton>
                            </span>
                        </div>
                        <div class="i-con-cn" style="float:left;margin:0px 10px;float:left;height:35px;line-height:35px;">
                            <span style="float: right;">
                                期次：
                                <asp:DropDownList ID="ddlQC" style="min-width: 200px;" runat="server"></asp:DropDownList>
                            </span>
                            <span id="IDCardSearch" runat="server" style="float: right;">
                                身份证号：
                                <asp:TextBox ID="txtIDCard" runat="server" style="border:1px solid gray;margin-right:10px;width:150px;padding:2px;" />
                            </span>
                            <span id="expertNameSearch" runat="server" style="float: right;">
                                姓名：
                                <asp:TextBox ID="txtExpertName" runat="server" style="border:1px solid gray;margin-right:10px;width:60px;padding:2px;" />
                            </span>
                        </div>
                    </div>
                    <div style="clear:both;"></div>
                    <telerik:RadGrid ID="RadGrid1" ClientIDMode="Static" runat="server" ShowStatusBar="True" AllowSorting="true"
                        CssClass="tab" AllowFilteringByColumn="false" CellSpacing="0" Culture="zh-CN"
                        GridLines="None" AllowPaging="true" AllowCustomPaging="true" OnNeedDataSource="RadGrid1_NeedDataSource"
                        Width="100%">
                        <MasterTableView Font-Size="16px" AutoGenerateColumns="false" DataKeyNames="ID" NoMasterRecordsText="没有考试信息"
                            InsertItemPageIndexAction="ShowItemOnCurrentPage" CommandItemDisplay="Top">
                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="true">
                            </RowIndicatorColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <PagerStyle AlwaysVisible="True" />
                            <CommandItemTemplate>
                            </CommandItemTemplate>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="选择" UniqueName="Choose" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <input id="ckbChoose" type="checkbox" value='<%#Eval("ID") %>' flag='<%#Eval("QCID") %>'
                                            runat="server" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="期次" UniqueName="Title" HeaderStyle-Width="25%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%#Eval("Title")%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="Area" HeaderText="所在地" UniqueName="Area" HeaderStyle-Width="8%"
                                    HeaderStyle-HorizontalAlign="Center" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CorpName" HeaderText="名称" UniqueName="CorpName"
                                    HeaderStyle-Width="10%" HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="EmpCount" HeaderText="报名人数" UniqueName="EmpCount"
                                    HeaderStyle-Width="5%" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="报名缴费情况" HeaderStyle-Width="10%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%# GetExamPayStatus(Eval("QCID"), Eval("CorpUserGuid"))%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="订单号" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <a href="" target="_blank" style="color:Blue;">查看</a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="StartDate" SortExpression="StartDate" FilterListOptions="VaryByDataType"
                                    HeaderText="报名缴费开始时间" DataFormatString="{0:yyyy-MM-dd}" UniqueName="BMDate" HeaderStyle-Width="10%"
                                    HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="EndDate" SortExpression="EndDate" FilterListOptions="VaryByDataType"
                                    HeaderText="报名缴费截止时间" DataFormatString="{0:yyyy-MM-dd}" UniqueName="BMDate" HeaderStyle-Width="10%"
                                    HeaderStyle-HorizontalAlign="Center">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="考试说明" HeaderStyle-Width="5%"
                                    HeaderStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <a href="ExamConstruction.htm" target="_blank" style="color:Blue;">详细说明</a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="手机号码" HeaderStyle-Width="10%"
                                    HeaderStyle-HorizontalAlign="Center" Visible="false">
                                    <ItemTemplate>
                                        <%# GetEmpPhone(Eval("CorpUserGuid"))%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                            <Selecting AllowRowSelect="True"></Selecting>
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </div>
                <span id="notice" runat="server" style="color:Red;font-size:16px;">
                    <p>①发票会在考试当天考试开始之前，在考场中发放。</p>
                    <p>②因为银联在处理收费款项时可能存在延迟，所以如果确认支付成功，刷新该页面却仍显示【未报名缴费】时，请耐心等待20分钟或者联系客服(0532-85871505转5)。</p>
                </span>
                <div id="edit" runat="server" style="width: 70px;margin: 10px auto;">
                    <asp:LinkButton runat="server" style="background-color:Red;width:60px;" class="xtbiao1" 
                        ClientIDMode="Static" ID="lbBMPay" 
                        OnClick="lbBMPay_Click" OnClientClick="return IsAnyItemSelected()">报名缴费</asp:LinkButton>
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="con_m tt_left_bottom">
                &nbsp;
            </td>
            <td colspan="2" class="con_m">
                &nbsp;
            </td>
            <td class="tt_right_bottom">
                &nbsp;
            </td>
        </tr>
    </table>
    <div id="UDialog" style="margin: auto; width: 900px;">
        <telerik:RadAjaxLoadingPanel runat="server" ID="gridLoadingPanel">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="UserDialog" runat="server" Title="考试报名信息" Height="700px" Behaviors="Close"
                    Width="750px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"
                    Skin="WebBlue" VisibleStatusbar="False" CssClass="DialogCss">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    </div>
    <div id="win" class="k-content" style="display:none;">
        <div id="window">
            <div style="height:50px;color:Green;font-size:18px">
                <center>请您在新打开的页面上完成支付操作</center>
            </div>
            <p style="text-align:center">支付完成前请不要关闭此窗口</p>
            <p style="text-align:center;margin-top:8px">完成支付后请根据您的情况点击下面的按钮</p>
            <div style="width:300px;height:auto;margin:0 auto;margin-top:50px">
                <center>
                    <a id="linkpay" style="padding: 5px 10px;background: rgb(194, 221, 204);margin: 5px;" href="BmList.aspx">已完成支付</a>
                    <a id="linksupport" style="padding: 5px 10px;background: rgb(194, 221, 204);margin: 5px;" href="../AccountHelp/Help.aspx">支付遇到问题</a>
                    <br />
                    <br />
                    *如果没有弹出支付窗口，请点击
                    <a style="text-decoration:underline;margin-left:3px;color:Red;" target="_blank" href="评标专家管理系统考试报名操作简要说明 - 副本.htm">这里</a>
                </center>
            </div>
        </div>
    </div>
    <asp:HiddenField ID="hidArea" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hidQCID" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hidBMID" runat="server" ClientIDMode="Static" />
</asp:Content>
